package cn.yqn.feign;

import cn.yqn.doc.CourseDoc;
import cn.yqn.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class CourseEsFeignClientFallbackFactory implements FallbackFactory<CourseEsFeignClient> {
    @Override
    public CourseEsFeignClient create(Throwable throwable) {
        return new CourseEsFeignClient() {
            @Override
            public JSONResult saveCourseDoc(CourseDoc courseDoc) {
                return JSONResult.error("服务器崩溃..");
            }
        };
    }
}
